package view;
import javax.swing.JPanel;
import javax.swing.SpringLayout;
import javax.swing.JSeparator;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JComboBox;


public class MaterialSlipGenerate extends JPanel{
	private JTable table;
	public MaterialSlipGenerate() {
		SpringLayout springLayout = new SpringLayout();
		setLayout(springLayout);
		
		JLabel lblNewLabel = new JLabel("Date:");
		springLayout.putConstraint(SpringLayout.NORTH, lblNewLabel, 133, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, lblNewLabel, 22, SpringLayout.WEST, this);
		add(lblNewLabel);
		
		JLabel lblClick = new JLabel("Click");
		springLayout.putConstraint(SpringLayout.NORTH, lblClick, 133, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, lblClick, 55, SpringLayout.WEST, this);
		add(lblClick);
		
		JLabel lblSlipNo = new JLabel("Slip No.:");
		springLayout.putConstraint(SpringLayout.NORTH, lblSlipNo, 0, SpringLayout.NORTH, lblNewLabel);
		add(lblSlipNo);
		
		JLabel label = new JLabel("1");
		springLayout.putConstraint(SpringLayout.EAST, lblSlipNo, -6, SpringLayout.WEST, label);
		springLayout.putConstraint(SpringLayout.NORTH, label, 0, SpringLayout.NORTH, lblNewLabel);
		add(label);
		
		JLabel lblIssueNo = new JLabel("Issue No.:");
		springLayout.putConstraint(SpringLayout.EAST, label, -17, SpringLayout.WEST, lblIssueNo);
		springLayout.putConstraint(SpringLayout.NORTH, lblIssueNo, 0, SpringLayout.NORTH, lblNewLabel);
		add(lblIssueNo);
		
		JLabel label_1 = new JLabel("762");
		springLayout.putConstraint(SpringLayout.WEST, label_1, 470, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST, lblIssueNo, -6, SpringLayout.WEST, label_1);
		springLayout.putConstraint(SpringLayout.NORTH, label_1, 0, SpringLayout.NORTH, lblNewLabel);
		add(label_1);
		
		JLabel lblNameOfContractor = new JLabel("Name Of Contractor:");
		springLayout.putConstraint(SpringLayout.NORTH, lblNameOfContractor, 12, SpringLayout.SOUTH, lblClick);
		springLayout.putConstraint(SpringLayout.WEST, lblNameOfContractor, 24, SpringLayout.WEST, this);
		add(lblNameOfContractor);
		
		JLabel lblNameOfEnggsite = new JLabel("Name Of Engg/Site Sup.:");
		springLayout.putConstraint(SpringLayout.NORTH, lblNameOfEnggsite, 12, SpringLayout.SOUTH, lblNameOfContractor);
		springLayout.putConstraint(SpringLayout.WEST, lblNameOfEnggsite, 22, SpringLayout.WEST, this);
		add(lblNameOfEnggsite);
		
		JLabel lblIssueFollowingMaterial = new JLabel("Issue Following Material For:");
		springLayout.putConstraint(SpringLayout.NORTH, lblIssueFollowingMaterial, 12, SpringLayout.SOUTH, lblNameOfEnggsite);
		springLayout.putConstraint(SpringLayout.WEST, lblIssueFollowingMaterial, 0, SpringLayout.WEST, lblNewLabel);
		add(lblIssueFollowingMaterial);
		
		JLabel lblBldgNo = new JLabel("Bldg. No.:");
		springLayout.putConstraint(SpringLayout.NORTH, lblBldgNo, 246, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, lblBldgNo, 22, SpringLayout.WEST, this);
		add(lblBldgNo);
		
		JLabel lblFlatNo = new JLabel("Flat No.:");
		springLayout.putConstraint(SpringLayout.NORTH, lblFlatNo, 0, SpringLayout.NORTH, lblBldgNo);
		springLayout.putConstraint(SpringLayout.WEST, lblFlatNo, 144, SpringLayout.EAST, lblBldgNo);
		add(lblFlatNo);
		
		JSeparator separator_1 = new JSeparator();
		springLayout.putConstraint(SpringLayout.WEST, separator_1, 10, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, separator_1, -589, SpringLayout.SOUTH, this);
		springLayout.putConstraint(SpringLayout.EAST, separator_1, -10, SpringLayout.EAST, this);
		add(separator_1);
		
		JSeparator separator_2 = new JSeparator();
		springLayout.putConstraint(SpringLayout.NORTH, separator_2, 19, SpringLayout.SOUTH, lblBldgNo);
		springLayout.putConstraint(SpringLayout.WEST, separator_2, 10, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST, separator_2, -10, SpringLayout.EAST, this);
		add(separator_2);
		
		JScrollPane scrollPane = new JScrollPane();
		
		springLayout.putConstraint(SpringLayout.NORTH, scrollPane, 301, SpringLayout.NORTH, this);
	
		springLayout.putConstraint(SpringLayout.WEST, scrollPane, 10, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, scrollPane, -51, SpringLayout.SOUTH, this);
		springLayout.putConstraint(SpringLayout.EAST, scrollPane, -10, SpringLayout.EAST,this);
		add(scrollPane);
		
		table = new JTable();
		table.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				" No.", "Item", "Unit", "Required Qty.", "Issue Qty.", "Receiver's Sign"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false, false, true, true, true
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		table.getColumnModel().getColumn(0).setPreferredWidth(45);
		table.getColumnModel().getColumn(1).setPreferredWidth(138);
		table.getColumnModel().getColumn(3).setPreferredWidth(84);
		table.getColumnModel().getColumn(5).setPreferredWidth(88);
		scrollPane.setViewportView(table);
		
		JLabel lblUniversalConstructionProjects = new JLabel("UNIVERSAL CONSTRUCTION PROJECTS");
		springLayout.putConstraint(SpringLayout.NORTH, lblUniversalConstructionProjects, 10, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, lblUniversalConstructionProjects, 158, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, lblUniversalConstructionProjects, 38, SpringLayout.NORTH, this);
		add(lblUniversalConstructionProjects);
		
		JLabel lblGatNoapshirwal = new JLabel("Gat No. 254,A/p.Shirwal, Near Pandharpur Phata,");
		springLayout.putConstraint(SpringLayout.WEST, lblGatNoapshirwal, 131, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.NORTH, lblGatNoapshirwal, 6, SpringLayout.SOUTH, lblUniversalConstructionProjects);
		add(lblGatNoapshirwal);
		
		JLabel lblTalKhandalaDist = new JLabel("Tal. Khandala, Dist. Satara.");
		springLayout.putConstraint(SpringLayout.NORTH, separator_1, 6, SpringLayout.SOUTH, lblTalKhandalaDist);
		springLayout.putConstraint(SpringLayout.NORTH, lblTalKhandalaDist, 0, SpringLayout.SOUTH, lblGatNoapshirwal);
		springLayout.putConstraint(SpringLayout.WEST, lblTalKhandalaDist, 179, SpringLayout.WEST, this);
		add(lblTalKhandalaDist);
		
		JLabel lblStoreSign = new JLabel("STORE SIGN:");
		springLayout.putConstraint(SpringLayout.WEST, lblStoreSign, 0, SpringLayout.WEST, lblNewLabel);
		springLayout.putConstraint(SpringLayout.SOUTH, lblStoreSign, -10, SpringLayout.SOUTH, this);
		add(lblStoreSign);
		
		JLabel lblSiteEngineerSign = new JLabel("SITE ENGINEER SIGN:");
		springLayout.putConstraint(SpringLayout.WEST, lblSiteEngineerSign, 158, SpringLayout.EAST, lblStoreSign);
		springLayout.putConstraint(SpringLayout.SOUTH, lblSiteEngineerSign, 0, SpringLayout.SOUTH, lblStoreSign);
		add(lblSiteEngineerSign);
		
		JLabel lblMaterialIssueSlip = new JLabel("MATERIAL ISSUE SLIP");
		springLayout.putConstraint(SpringLayout.NORTH, lblMaterialIssueSlip, 16, SpringLayout.SOUTH, separator_1);
		springLayout.putConstraint(SpringLayout.WEST, lblMaterialIssueSlip, 203, SpringLayout.WEST, this);
		add(lblMaterialIssueSlip);
		
		JComboBox comboBox = new JComboBox();
		springLayout.putConstraint(SpringLayout.NORTH, comboBox, 81, SpringLayout.SOUTH, lblTalKhandalaDist);
		springLayout.putConstraint(SpringLayout.WEST, comboBox, 43, SpringLayout.EAST, lblNameOfContractor);
		springLayout.putConstraint(SpringLayout.EAST, comboBox, 18, SpringLayout.EAST, lblFlatNo);
		add(comboBox);
		
		JComboBox comboBox_1 = new JComboBox();
		springLayout.putConstraint(SpringLayout.WEST, comboBox_1, -106, SpringLayout.EAST, comboBox);
		springLayout.putConstraint(SpringLayout.SOUTH, comboBox_1, 0, SpringLayout.SOUTH, lblNameOfEnggsite);
		springLayout.putConstraint(SpringLayout.EAST, comboBox_1, 0, SpringLayout.EAST, comboBox);
		add(comboBox_1);
		
		JComboBox comboBox_2 = new JComboBox();
		springLayout.putConstraint(SpringLayout.NORTH, comboBox_2, -3, SpringLayout.NORTH, lblIssueFollowingMaterial);
		springLayout.putConstraint(SpringLayout.WEST, comboBox_2, 6, SpringLayout.EAST, lblIssueFollowingMaterial);
		springLayout.putConstraint(SpringLayout.EAST, comboBox_2, 0, SpringLayout.EAST, comboBox);
		add(comboBox_2);
	}
}
